import redis

def main():
    client = redis.Redis(host='47.110.246.28',port=6379,password='jia977911')
    client.set('test','贾大帅',ex=100)
    print(client.ttl('test'))
    print(client.get('test').decode())
    client.set('xiaopiaoliang','10')
    client.incr('xiaopiaoliang')
    print(int(client.get('xiaopiaoliang').decode()))
    client.hset('stut3','id','1001')
    client.hset('stut4','id','1002')
    print(client.hgetall('stut3'))
    print(client.hget('stut3','id').decode())
    client.rpush('list1',10,11,12,13)
    print(client.lrange('list1',0,-1))

if __name__ == '__main__':
    main()